package com.neusoft.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neusoft.mapper.CurrencyMapper;
import com.neusoft.po.Currency;
import com.neusoft.service.CurrencyService;

@Service
public class CurrencyServiceImpl implements CurrencyService{

	@Autowired
	CurrencyMapper currencyMapper;
	
	@Override
	public int saveCurrency(String userId, Double amount) {
		return currencyMapper.saveCurrency(userId, amount);
	}
	
	@Override
	public Currency getCurrencyByUserId(String userId) {
		return currencyMapper.getCurrencyByUserId(userId);
	}

	@Override
	public int addCurrencyByUserId(Double addAmount, String userId) {
		System.out.println("service: " + addAmount + " " + userId);
		return currencyMapper.addCurrencyByUserId(addAmount, userId);
	}

	@Override
	public int minusCurrencyByUserId(Double minusAmount, String userId) {
		return currencyMapper.minusCurrencyByUserId(minusAmount, userId);
	}

	

}
